**************************************************
********* Table A1.1: Observed Number of *********
********* Non-Winning Candidate Comparisons ******
**************************************************

do "do_files/prep_GRACE_data/load_prep_GRACE_data.do"

mat non_win = J(2,1,0)

preserve

* Need this line to get reproducible results based on bysort
set sortseed 1234

by graceuniqid, sort: egen newgraceuniqidwin = max(v24)
drop if basket_lat!=1
duplicates drop graceuniqid, force


* Number of non-winning Latina/o Candidates 2000 in GRACE
quietly count if newgraceuniqidwin == 0 & v05==2000 & basket_lat == 1
mat non_win[1,1] = r(N)

* Number of non-winning Latina/o Candidates 2010 in GRACE
quietly count if newgraceuniqidwin == 0 & v05==2010 & basket_lat == 1
mat non_win[2,1] = r(N)

mat rownames non_win = "(2000) # nonwinning Latina/o" "(2010) # nonwinning Latina/o"
mat colnames non_win = "GRACE"
mat list non_win


* pausing for users who might be looping through all replication files
pause

